package com.ruoyi.background.service.impl;

import com.ruoyi.background.domain.AppWorkTeamUser;
import com.ruoyi.background.mapper.AppWorkTeamUserMapper;
import com.ruoyi.background.service.IAppWorkTeamUserService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 队伍成员Service业务层处理
 *
 * @author susu
 * @date 2024-09-04
 */
@Service
public class AppWorkTeamUserServiceImpl implements IAppWorkTeamUserService {
    @Autowired
    private AppWorkTeamUserMapper appWorkTeamUserMapper;

    /**
     * 查询队伍成员
     *
     * @param id 队伍成员主键
     * @return 队伍成员
     */
    @Override
    public AppWorkTeamUser selectAppWorkTeamUserById(Long id) {
        return appWorkTeamUserMapper.selectAppWorkTeamUserById(id);
    }

    /**
     *
     * @param userId 用户id
     * @return
     */
    @Override
    public AppWorkTeamUser selectAppWorkTeamUserByUserId(Long userId) {
        return appWorkTeamUserMapper.selectAppWorkTeamUserByUserId(userId);
    }

    /**
     * 查询队伍成员列表
     *
     * @param appWorkTeamUser 队伍成员
     * @return 队伍成员
     */
    @Override
    public List<AppWorkTeamUser> selectAppWorkTeamUserList(AppWorkTeamUser appWorkTeamUser) {
        return appWorkTeamUserMapper.selectAppWorkTeamUserList(appWorkTeamUser);
    }

    /**
     * 新增队伍成员
     *
     * @param appWorkTeamUser 队伍成员
     * @return 结果
     */
    @Override
    public int insertAppWorkTeamUser(AppWorkTeamUser appWorkTeamUser) {
        appWorkTeamUser.setCreateTime(DateUtils.getNowDate());
        return appWorkTeamUserMapper.insertAppWorkTeamUser(appWorkTeamUser);
    }

    /**
     * 修改队伍成员
     *
     * @param appWorkTeamUser 队伍成员
     * @return 结果
     */
    @Override
    public int updateAppWorkTeamUser(AppWorkTeamUser appWorkTeamUser) {
        return appWorkTeamUserMapper.updateAppWorkTeamUser(appWorkTeamUser);
    }

    /**
     * 批量删除队伍成员
     *
     * @param ids 需要删除的队伍成员主键
     * @return 结果
     */
    @Override
    public int deleteAppWorkTeamUserByIds(Long[] ids) {
        return appWorkTeamUserMapper.deleteAppWorkTeamUserByIds(ids);
    }

    /**
     * 删除队伍成员信息
     *
     * @param id 队伍成员主键
     * @return 结果
     */
    @Override
    public int deleteAppWorkTeamUserById(Long id) {
        return appWorkTeamUserMapper.deleteAppWorkTeamUserById(id);
    }
}
